if [ -e /dev/tcaicard0 ];then
        AICARD_NUM=`ls /dev/tcaicard* | wc -l`
else
        echo "No card !"
        exit 1
fi



PSY_AICARD_NUM_1=`expr $AICARD_NUM / 4`
let PSY_AICARD_NUM=${PSY_AICARD_NUM_1}-1

CURTIME=`date +%m%d%H%M`
echo $CURTIME


lock_file=/tmp/test_func.lock_all
if [ -f $lock_file ];then
    rm -rf $lock_file
fi
touch $lock_file
for card_id in `seq 0 ${PSY_AICARD_NUM}`
do
    sh hbm.sh $card_id $CURTIME --card_id_$card_id &
done

#while [[ $(cat $lock_file | wc -l) < $PSY_AICARD_NUM_1 ]]; do
#    sleep 1
#done

wait

echo "function finished"
